<!DOCTYPE html>
<html lang="en">
	<head>
		<include file="Index/head" />
	</head>

	<body>
		<include file="Index/header" />

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<include file="Index/menu" />
				
				<div class="main-content">
					<include file="Index/nav" />

					<div class="page-content">
						
							<!-- /**
							 * 右侧页面begin
							 */ -->
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<form class="form-horizontal" role="form" method="POST" enctype="multipart/form-data">
								<div class="space-4"></div>
								<div class="space-4"></div>
								<div class="space-4"></div>
                                                                <h3 class="header smaller lighter blue">
										产品基本资料
										<small>{$sql_str}</small>
									</h3>
                                                                <div class="form-group">
                                                                        <label class="col-sm-3 control-label no-padding-right" > 产品名称: </label>
                                                                        <div class="col-sm-9">
                                                                                <input type="text"  value='{$product.name}' disabled='disabled'   class="col-xs-10 col-sm-5">
                                                                        </div>
                                                                </div>
                                                                <div class="space-4"></div>
                                                                <div class="form-group">
                                                                        <label class="col-sm-3 control-label no-padding-right" > 产品分类: </label>
                                                                        <div class="col-sm-9">
                                                                                <input type="text" value='{$product.classify_name}' disabled='disabled'   class="col-xs-10 col-sm-5">
                                                                        </div>
                                                                </div>
                                                                <div class="space-4"></div>
                                                                <div class="form-group">
                                                                        <label class="col-sm-3 control-label no-padding-right" > 产品品牌: </label>
                                                                        <div class="col-sm-9">
                                                                                <input type="text"  value='{$product.brand}' disabled='disabled'   class="col-xs-10 col-sm-5">
                                                                        </div>
                                                                </div>
                                                                <div class="space-4"></div>
                                                                <div class="form-group">
                                                                        <label class="col-sm-3 control-label no-padding-right" > 条码: </label>
                                                                        <div class="col-sm-9">
                                                                                <input type="text" value='{$product.barcode}' disabled='disabled' class="col-xs-10 col-sm-5">
                                                                        </div>
                                                                </div>
                                                                <input type='hidden' name='pid' value='{$product.id}' />
                                                                <h3 class="header smaller lighter blue">
										已关联数据
										<small></small>
									</h3>
                                                                <!--已经匹配好的数据-->
                                                                <volist name='match_data' id='vo'>
                                                                <div class="space-4"></div>
                                                                <div class="form-group">
                                                                        <label class="col-sm-3 control-label no-padding-right" > </label>
                                                                        <div class="col-sm-9">
                                                                            <label>(编号:{$vo.thirdparty.id}) -- {$vo.thirdparty.product_name}  -- <small>操作时间 {$vo.thirdparty.ctime|date="Y-m-d H:i",###}</small>  <a href="{:U('product2third_part_product_del',array('id'=>$vo['id']))}">删除关联</a></lable>
                                                                        </div>
                                                                </div>
                                                                </volist>
                                                                
                                                                <!--带操作的数据-->
                                                                <h3 class="header smaller lighter blue">
										待关联数据
										<small>同分类,同品牌</small>
									</h3>
                                                                
                                                                <volist name='results' id='vo'>
                                                                <div class="space-4"></div>
                                                                <div class="form-group">
                                                                        <label class="col-sm-3 control-label no-padding-right" > <input name="thirdid[]" value='{$vo.id}' type="checkbox" > </label>
                                                                        <div class="col-sm-9">
                                                                             <label> {$vo.product_name}  </label>
                                                                        </div>
                                                                </div>
                                                                </volist>
                                                                
									
                                                                <div class="space-4"></div>

                                                                <div class="form-group">
                                                                <label class="col-sm-3 control-label no-padding-right" for="form-field-2"></label>
                                                                &nbsp;&nbsp;&nbsp;
                                                                <div class="space-4"></div>

                                                                </div>


                                                                <div class="clearfix form-actions">
                                                                        <div class="col-md-offset-3 col-md-9">
                                                                                <button class="btn btn-info" type="submit">
                                                                                        <i class="icon-ok bigger-110"></i>
                                                                                        添加
                                                                                </button>									
                                                                        &nbsp; &nbsp; &nbsp;
                                                                        <a href="{:U('lists')}">
                                                                                <button class="btn" type="button">
                                                                                        <i class="icon-undo bigger-110"></i>
                                                                                        返回
                                                                                </button>
                                                                        </a>

                                                                        </div>
                                                                </div>

                                                                <div class="hr hr-24"></div>

                                                                </div><!-- /row -->

								</form>

						</div>
							<!-- /**
							 * 右侧页面end
							 */ -->
					</div><!-- /.page-content -->
				</div>

			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<include file="Index/footer" />
		<script type="text/javascript">
		$(document).ready(function(){
			$("#classify").change(function(){
				$("#classify_son").empty();
				var id=$("#classify").val();
				var url="{:U('Admin/Product/ready_classify')}"
				$.ajax({
					type:'post',
					url:url,
					data:{id:id},
					dataType:'json',
					success: function(data){
						var str='';
						$.each(data,function(k,v){
							str+="<option value='"+v['id']+"'>";
							str+=v['name']+"</option>";
						});

						$("#classify_son").append(str);
					}
				});
			});

		});
		</script>
	</body>
</html>
